package com.tjec.project.fineReport;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.ModelAndView;

import com.tjec.framework.web.controller.BaseController;

@Controller
@RequestMapping("/fineReport")
public class FineReportController extends BaseController{
	
	@CrossOrigin(origins = "*",maxAge = 3600)
	@GetMapping("/fineReportSso")
	public void ssoFineReport(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//return "forward:http://report.tongji-ec.com.cn/decision?fr_username=H04-00091";
		response.sendRedirect("http://www.baidu.com");
	}

	
	public final static long getMaxSize(String maxSize) {
    	boolean temVar = true;
    	Integer _maxSize = 0;
    	try {
    		_maxSize = Integer.valueOf(maxSize);
		} catch (Exception e) {
			temVar = false;
		}
    	
    	if(!temVar) {
    		_maxSize = 10*1024;
    	}
    	return _maxSize;
    }
	
	public static void main(String[] args) {
		
		long a = getMaxSize("5120");
		System.out.println(a);
		System.out.println(1*1024*1024*1024);
		int b = 5*1024*1024*1024;
		System.out.println(b);
	}
    
    
}
